{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import Callable\n",
    "\n",
    "def args(t: int):\n",
    "    def inner(func: Callable):\n",
    "        def wrapper(*args, **kwargs):\n",
    "            print(t)\n",
    "            return func(*args, **kwargs)\n",
    "        return wrapper\n",
    "    return inner\n",
    "\n",
    "# @args(10)\n",
    "def f():\n",
    "    print(\"f\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "4\n",
      "f\n"
     ]
    }
   ],
   "source": [
    "\n",
    "def main() -> None:\n",
    "    f1 = args(4)\n",
    "    f2 = f1(f)\n",
    "    f2()\n",
    "    # f()\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    main()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "jupter-env-10",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
